<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
</style>
<script type="text/html" id="photos-item-wrapper">
	<li id="savedimage{id}">
		<input id="photo-{id}" type="hidden" name="photos_url[]" value="{filepath}"> 
		<input id="photo-{id}-name" type="text" name="photos_alt[]" value="{name}" style="width: 160px;" title="图片名称">
		<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;" onclick="parent.image_preview_dialog(this.src);">
		<a href="javascript:upload_one_image('图片上传','#photo-{id}');">替换</a>
		<a href="javascript:(function(){$('#savedimage{id}').remove();})();">移除</a>
	</li>
</script>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('active/activelist')}">活动管理</a></li>
			<li><a href="{:U('active/activeadd')}">活动添加</a></li>
			<li class="active"><a>活动编辑</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('active/activeedit_post')}">
			<div class="row-fluid">
				<div class="span9">
					<table class="table table-bordered">
						<tr>
						<th width="80">活动标题</th>
							<td>
								<input type="text" style="width:400px;" name="frm[subject]" value="{$active.subject}" placeholder="活动标题"/>
								<span class="form-required">*</span>
							</td>
						</tr>
						<tr>
						<th width="80">活动简短标题</th>
							<td>
								<input type="text" style="width:400px;" name="frm[subject1]" value="{$active.subject1}" placeholder="活动简短标题"/>
							</td>
						</tr>
						<tr>
							<th>活动视频</th>
							<td>
								<script type="text/plain" id="content1" name="post[desc]">{$active.desc}</script>
							</td>
						</tr>
						<tr>
							<th>活动详情</th>
							<td>
								<script type="text/plain" id="content2" name="post[body]">{$active.body}</script>
							</td>
						</tr>
					</table>
				</div>
				<div class="span3">
					<table class="table table-bordered">
						<tr>
							<th><b>列表图</b></th>
						</tr>
						<tr>
							<td>
								<div style="text-align: center;">
									<input type="hidden" name="frm[thumbsimg]" id="simg" value="{$active.thumbsimg}">
									<a href="javascript:upload_one_image('图片上传','#simg');">
										<if condition="empty($active['thumbsimg'])">
											<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="simg-preview" width="135" style="cursor: hand" />
										<else />
											<img src="{:sp_get_image_preview_url($active['thumbsimg'])}" id="simg-preview"  width="135" style="cursor: hand;"/>
										</if>
									</a>
									<input type="button" class="btn btn-small" onclick="$('#simg-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#simg').val('');return false;" value="取消图片">
								</div>
							</td>
						</tr>
						<!-- <tr>
							<th><b>最终图</b></th>
						</tr>
						<tr>
							<td>
								<div style="text-align: center;">
									<input type="hidden" name="frm[thumbimg]" id="img" value="{$active.thumbimg}">
									<a href="javascript:upload_one_image('图片上传','#img');">
										<if condition="empty($active['thumbimg'])">
											<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="img-preview" width="135" style="cursor: hand" />
										<else />
											<img src="{:sp_get_image_preview_url($active['thumbimg'])}" id="img-preview"  width="135" style="cursor: hand;"/>
										</if>
									</a>
									<input type="button" class="btn btn-small" onclick="$('#img-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#img').val('');return false;" value="取消图片">
								</div>
							</td>
						</tr> -->
						<tr>
							<th><b>发布时间</b></th>
						</tr>
						<tr>
							<td><input type="text" name="frm[create_time]" value="{$active.create_time}" class="js-datetime" style="width: 160px;"></td>
						</tr>
						<tr>
							<th><b>状态</b></th>
						</tr>
						<tr>
							<td>
								<php>
									$status_yes=$active['status']==1?"checked":"";
									$status_no=$active['status']==2?"checked":"";
								</php>
								<label class="radio"><input type="radio" name="frm[status]" {$status_yes} value="1">启用</label>
								<label class="radio"><input type="radio" name="frm[status]" {$status_no} value="2">禁用</label>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="form-actions">
				<input type="hidden" name="id" value="{$active.activeid}"/>
				<button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
				<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
		//编辑器路径定义
		var editorURL = GV.WEB_ROOT;
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript">
		$(function() {
				editorcontent1 = new baidu.editor.ui.Editor({
			        toolbars:[['source','insertvideo']]
				});
				editorcontent1.render('content1');
				try {
					editorcontent1.sync();
				} catch (err) {
				}
				editorcontent2 = new baidu.editor.ui.Editor();
				editorcontent2.render('content2');
				try {
					editorcontent2.sync();
				} catch (err) {
				}
		});
	</script>
</body>
</html>